home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20020314-20021006
/
000025_msapiro@value.net_Sat Apr 6 11:41:03 EST 2002.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
3KB
|
76 lines
Article: 13296 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!panix!news-xfer.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!bcandid.telisphere.com!not-for-mail
Message-ID: <3CAE6AD5.F70DD5C8@value.net>
From: Mark Sapiro <msapiro@value.net>
Organization: Not Very Much
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en,en-US,en-GB
MIME-Version: 1.0
Newsgroups: comp.protocols.kermit.misc
Subject: Re: How to get return code from external Unix box running simple shell
script?
References: <d6e12cad.0204051329.574003a2@posting.google.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 53
Date: Sat, 06 Apr 2002 03:16:08 GMT
NNTP-Posting-Host: 209.182.169.133
X-Complaints-To: abuse@telisphere.com
X-Trace: bcandid.telisphere.com 1018062968 209.182.169.133 (Fri, 05 Apr 2002 19:16:08 PST)
NNTP-Posting-Date: Fri, 05 Apr 2002 19:16:08 PST
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13296
Entfred wrote:
> 1. Kermit script (on a Windows 2000 PC) telnets to an external Sun
> Unix box. The Kermit script is in a file called test.ksc:
>
> set term type at386
>
> set network tcp/ip
> set host test.machine.com
> output \13
> input 5 login:
> output testuser\13
> input 5 password:
> output testpassword\13
> input 5 $
> output testscript\13
> connect
You can't connect. Connect mode suspends your script until the mode is
exited by the user. You almost never want to connect in a script unless
it's maybe the last thing in a login type script.
> if fail (I am not sure what do do right here to get Unix return code)
> Exit
> End ;
>
> 2. On the Unix box, a simple script is run:
> (call the script, testscript)
>
> echo This is a test
> date
> exit 9
>
> 3. I would like the result code of 9 to be sent back to the kermit
> script residing on the Windows 2000 PC.
>
> How would this be done? Any tips to doing this would be
> appreciated!
You could try something like the following:
{login stuff}
output kermit -x\13 ; start remote kermit server
input 5 {READY TO SERVE...}
if failure ...
remote host testscript ; run testscript via remote kermit
remote query kermit pexitstat ; query the exit status
; at this point \v(query) contains the return code from testscript
finish ; terminate the remote server
; test \v(query) and proceed accordingly
--
Mark Sapiro <msapiro@value.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan